/**     
* @Title: StreamRabbitApplication.java   
* @Package me.cloud   
* @Description: TODO   
* @author xaoyaoyao
* @date 2018年12月8日 上午10:11:22
*/
package me.cloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.messaging.handler.annotation.SendTo;

/**
 * @ClassName: StreamRabbitApplication
 * @Description: TODO
 * @author xaoyaoyao
 * @date 2018年12月8日 上午10:11:22
 * 
 */
@SpringBootApplication
@EnableBinding(Processor.class)
public class StreamRabbitApplication {

	public static void main(String[] args) {
		SpringApplication.run(StreamRabbitApplication.class, args);
	}
	
	@StreamListener(Processor.INPUT)
    @SendTo(Processor.OUTPUT)
    public LogMessage enrichLogMessage(LogMessage log) {
        return new LogMessage(String.format("[1]: %s", log.getMessage()));
    }
}
